import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import sklearn
import sys
import os
import pandas as pd
import tensorflow as tf
from tensorflow.python import keras
from tensorflow.python.keras.models import load_model
import cv2


# 读取model
model = load_model('./model/明星识别.h5')
# 读取图片1
testData = np.empty((4,128,128,3),dtype="float32")
imgData1 = cv2.imread('../dataset/明星分类/鞠婧祎/0fe2edc567c3da4dcad0129f71b17334.jpg')
arr = np.asarray(imgData1, dtype="float32")
testData[0, :, :, :] = arr

imgData2 = cv2.imread('../dataset/明星分类/孙允珠/5e23b4cca227f15cea6940d1bff1c515.jpg')
arr = np.asarray(imgData2, dtype="float32")
testData[1, :, :, :] = arr

imgData3 = cv2.imread('../dataset/明星分类/孙允珠/063e26cc7a08b94df55314a71dd5cf34.jpg')
arr = np.asarray(imgData3, dtype="float32")
testData[2, :, :, :] = arr

# 读取图片2
imgData4 = cv2.imread('../dataset/明星分类/鞠婧祎/5cd4e0cf923a74bc7b049a5f7954c98d.jpg')
arr = np.asarray(imgData4, dtype="float32")
testData[3, :, :, :] = arr
print(model.predict(testData))
